package cn.pconline.autoclub.util;

/**
 * Regex
 *
 * @author <a href="mailto:shuyaochen@sina.com">陈树钥</a>
 * @version 1.0
 * @since 2012-1-4 12:56:05
 */
public enum Regex {

    specialPhone("^(13800)[0-9]{6}$", ""),
    cellphone("^(13|14|15|18|17)[0-9]{9}$", ""),
    ip("^(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)$", ""),
    email("^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$", ""),
    name("^[a-zA-Z0-9\\-_.\u4e00-\u9fa5]+$", "只能含有汉字、数字、字母、下划线、减号、圆点"),
    nameAdditional("^\\d+$", ""),//，且不能纯数字
    postcode("^\\d{6}$", "邮编要求格式是6位数字"),
    trueName("([\\u4e00-\\u9fa5])*", "请输入中文名"),
    pcautoLink("^(https?:\\/\\/)?([\\da-z\\.-]+)(\\.pcauto\\.com\\.cn)(.)*$","仅限太平洋汽车网的链接"),
    link("^https?://([\\w\\-]+\\.)+[\\w\\-]+((:\\d+)?/[\\w \\-\\./?%&=]*)?","仅限超链接"),
    telephone("^(([0\\+]\\d{2,3}-)?(0\\d{2,3})-)?(\\d{7,8})(-(\\d{3,}))?$", "电话号码要求格式如：020-1234567"),////电话号码的函数(包括验证国内区号,国际区号,分机号)
    letterornum("^\\w+$","字母或者数字"),
    chineseNumAbc("^[\\u4E00-\\u9FA5\\uF900-\\uFA2D\\w]+$","汉字、字母、数字"),//车友会名称验证
    clubtype("^\\w+/(album|comment|activity|member|topic)","车友会拦截url字符串"),
    number("^\\d+$","纯数字"),
    qqGroup("^\\d{1,20}$","QQ群群号要求20位数字以内"),//QQ群 20个数字以内
    url("(http:|https:)//[^[A-Za-z0-9\\._\\?%&+\\-=/#]]*",""),
    realName("^[\\u4e00-\\u9fa5]+$", "名字只可以是中文"),//名字只可以是中文
    subjectRule("#([^#]+)#", "无法匹配话题");//话题规则
    //subjectRule("#(.+?)#", "无法匹配话题");//话题规则
    
    public final String value;
    public final String tip;

    /**
     *
     * @param regex
     */
    Regex(String regex, String tip) {
        this.value = regex;
        this.tip = tip;
    }

    public String getTip() {
        return tip;
    }
}
